<?php
/**
 * 菜单管理
 * Created by PhpStorm
 * User: long
 * Date: 2019/11/28
 * Time: 16:53
 */

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;

class MenuController extends Controller
{
    public function __construct()
    {
        parent::__construct();
    }


    public function getList()
    {
        return $this->app->menu->list();
    }

    public function getCurrentList()
    {
        return $this->app->menu->current();
    }

    public function store()
    {
        $buttons = [
            [
                "type" => "click",
                "name" => "今日歌曲",
                "key" => "V1001_TODAY_MUSIC"
            ],
            [
                "name" => "菜单",
                "sub_button" => [
                    [
                        "type" => "view",
                        "name" => "搜索",
                        "url" => "http://www.soso.com/"
                    ],
                    [
                        "type" => "view",
                        "name" => "视频",
                        "url" => "http://v.qq.com/"
                    ],
                    [
                        "type" => "click",
                        "name" => "赞一下我们",
                        "key" => "V1001_GOOD"
                    ],
                ],
            ],
        ];
        return $this->app->menu->create($buttons);
    }

}